#pragma once


#include "Misc/CommonMacros.h"
#include "Widgets/TextWidget.h"
#include "Widget.h"
#include "Windows/PopWindow.h"
#include "ComboBoxWidget.m.h"

RCLASS()
class WHENGINE_API RComboBoxWidget : public RWidget
{
    ROBJECT

public:
    RComboBoxWidget();

    bool IsPopWindowOpen() const;


    void SetCurrentText(const CString& InText);

    CString GetCurrentText() const;

    TDelegate<void,const CString& /*Selected text*/,uint32_t /*Selected Index*/ > OnSelected;

    void SetOptions(const TVector<CString> & InOptions);

protected:
    TVector<CString> ListItems;

    void ShowPopWindow();

    void HidePopWindow();

    bool OnClick(const SMouseButtonEvent&);

    RWindowWeakPtr PopWindow;
    //RVerticalPositionerWidgetPtr ItemContainer;

    TWeakObjectPtr<RTextWidget> Selected;
};